package demo;

public class Demo3 {
    public static void main(String[] args) {
        MyDate myDate = new MyDate(1990,1,1);
        myDate.showDate(1990,1,1);
        boolean leapYear = myDate.isLeapYear(1990);
        if (leapYear){
            System.out.println("1990年是闰年");
        }else{
            System.out.println("1990年不是闰年");
        }

    }
}
class MyDate{
    int year;
    int month;
    int day;
    public MyDate(int year,int month,int day){
        this.day=day;
        this.month=month;
        this.year=year;
    }
    void showDate(int year,int month,int day){
        System.out.println(year+"年"+month+"月"+day+"日");
    }
    boolean isLeapYear(int year){
        boolean flag=false;
        if (year%100!=0&&year%4==0){
            flag=true;
        }else if (year%100==0&&year%400==0){
            flag=true;
        }
        return flag;
    }
}